//
//  CreateJobModel.swift
//  GreenDeal
//
//  Created by Moennig Q on 1/3/2023.
//  提交到后台保存的数据结构

import UIKit
import HandyJSON

class CreateJobModel: HandyJSON {
    //第一步
    var company_id: Int = 0
    var agent_id: Int = 0
    //第二步
    var pvd_install_address = CreateJobInstallAddressModel()
    //第三步
    var pvd_owner_address = CreateJobOwnerInfoModel()
    //第四步
    var pvd_system = CreateJobSystemModel()
    //第五步
    var pvd_installer = CreateJobTechnicianModel()
    //
    var trade_mode: String = ""
    var customer_po: String = ""
    required init() {
        
    }
}
struct CreateJobInstallAddressModel {
    var geoscape_address_id: String = ""
    var address_text: String = ""
    var same_as_postal: String = ""//字符串true，或false
    var property_type: String = ""
    var nmi: String = ""
    var unit_type: String = ""
    var unit_number: String = ""
    var street_number: String = ""
    var street_name: String = ""
    var street_type: String = ""
    var post_code: String = ""
    var suburb: String = ""
    var state: String = ""
    var story: String = ""
    var installed_optimiser: String = ""//字符串true或false（ Will there be any optimisers installed?）
    //非必填项
    var panel_type: String = ""
    var phase: String = ""
    var grid_connection_application_ref_no: String = ""
    var roof: String = ""
}
struct CreateJobOwnerInfoModel{
    var owner_type: String = ""
    var first_name: String = ""
    var last_name: String = ""
    var owner_type_name: String = ""
    var owner_representative_name: String = ""
    var owner_representative_position: String = ""
    var price_to_the_home_owner: String = ""
    var home_owner_abn: String = ""
    var address_type: String = ""
    var address_text: String = ""
    var unit_type: String = ""
    var unit_number: String = ""
    var street_number: String = ""
    var street_name: String = ""
    var street_type: String = ""
    var post_code: String = ""
    var suburb: String = ""
    var state: String = ""
    var delivery_number: String = ""
    var delivery_type: String = ""
    var phone: String = ""
    var email: String = ""
    //co owner
    var co_owner_first_name: String = ""
    var co_owner_last_name: String = ""
    var co_owner_relation_ship: String = ""
}
struct CreateJobSystemModel {
    var installation_type: String = ""
    var install_date: String = ""
    var connected_type: String = ""
    var is_battery: String = ""
    var installer_job_site_instruction: String = ""
    var pvd_system_panels = [CreateJobSystemPanelModel]()
    var pvd_system_inverters = [CreateJobSystemInverterModel]()
    var pvd_system_batteries = [CreateJobSystemBatteryModel]()
}
struct CreateJobSystemPanelModel {
    var brand_id: String = ""
    var watts_per: String = ""
    var qty: String = ""
}
struct CreateJobSystemInverterModel {
    var brand_id: String = ""
    var qty: String = ""
}

struct CreateJobSystemBatteryModel {
    var brand_id: String = ""
    var qty: String = ""
    var battery_system_part_of_an_aggregated_control: String = ""//字符串true或false
    var changed_the_default_battery_manufacturer_setting: String = ""//字符串true或false
}
struct CreateJobTechnicianModel  {
    var installer_id: Int = 0
    var designer_id: Int = 0
    var electrician_id: Int = 0
    //
//    var job_site_instruction_for_the_installer: String = ""
//    var pick_up_required: Bool = false
//    var pick_up_address_id: Int = 0//对应接口中的id
//    var pick_up_address_text: String = ""//对应接口中对应的address_text
//    var pick_up_reference: String = ""
}
